#ifndef CIRCLETRACKER_H
#define CIRCLETRACKER_H

/* 
   CircleTracker.h
   Author: Mike Ciaraldi

   Contains the CircleTracker class, 
   which simulates a motion tracker by returning data for an object
   which moves in a circle at constnat distance.

*/

#include "Tracker.h"


// Constants for the circle. Distances in centimeters, angles in radians

#define DEFAULT_CIRCLE_CENTER_X (-100.0)
#define DEFAULT_CIRCLE_CENTER_Y (0.0)
#define DEFAULT_CIRCLE_CENTER_Z (0.0)
#define DEFAULT_CIRCLE_RADIUS   (50.0)
#define DEFAULT_ANGLE_INCREMENT (0.1)

#define CIRCLE_TRACKER_ERROR_MSG_SIZE 100

class CircleTracker: public Tracker {

 public:
  // Constructor(s) and Destructor
  CircleTracker(void); 
  ~CircleTracker(void);

  // Overriding methods:
  int open();
  int close();
  int poll(float *out);

  int sync(void);
  int start(void);
  int stop(void);
  int read(void);
  int nextFrame();
  int getData(int sensor, int channel, float &value);
  char *getErrorInfo(void);	
private:
  // Values for the circle. Distances in meters, angles in radians
  double center_x;
  double center_y;
  double center_z;
  double current_x;
  double current_y;
  double current_z;
  double radius;
  double current_angle;
  double angle_increment;

  /** Moves the simulated sensor to its next position.
   */
  void move();


  // error message
  char errorMsg[CIRCLE_TRACKER_ERROR_MSG_SIZE];
};



#endif /* CIRCLETRACKER_H */
